import request from '@/utils/request'

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/platform/order/list',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrder(orderId) {
  return request({
    url: '/platform/order/' + orderId,
    method: 'get'
  })
}

// 支付订单
export function payOrder(orderId) {
  console.log("pay order is "+orderId)
  return request({
    url: '/platform/order/pay/' + orderId,
    method: 'put'
  })
}


// 新增订单
export function addOrder(data) {
  return request({
    url: '/platform/order',
    method: 'post',
    data: data
  })
}

export function saveOrder(data) {
  return request({
    url: '/platform/order/detail',
    method: 'post',
    data: data
  })
}

// 修改订单
export function updateOrder(data) {
  return request({
    url: '/platform/order',
    method: 'put',
    data: data
  })
}

// 删除订单
export function delOrder(orderId) {
  return request({
    url: '/platform/order/' + orderId,
    method: 'delete'
  })
}

// 导出订单
export function exportOrder(query) {
  return request({
    url: '/platform/order/export',
    method: 'get',
    params: query
  })
}
